public class Test {

	// 求阶乘
	public static int fun(int n) {
		int ret = 1;
		for (int i = 1; i <= n; i++) {
			ret *= i;
		}
		return ret;
	}

	// 求阶乘的和
	public static int funSum(int k) {
		int sum = 0;
		for (int i = 1; i <= k; i++) {
			sum += fun(i);
		}
		return sum;
	}

	public static void main(String[] args) {
		System.out.println(funSum(5));
	}
}
